home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
tp_asm.exe
/
lha
/
USAGE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-07-31
|
10KB
|
411 lines
{═════════════════════════════ USAGE.PAS ═════════════════════════════}
{ Non-Executable file with sample assembly language instructions }
{═════════════════════════════ USAGE.PAS ═════════════════════════════}
(*══════════════════════════════ NOTES ═══════════════════════════════*
This file contains one or more examples of each 8086 instruction
mnemonic with a variety of combinations of operand types. It is not
intended as a replacement for a tutorial or reference on assembly
language programming, however in some cases a couple of examples
of typical instruction syntax is all that you may need. Please see
the various .PAS files (on the registration disk or in the archive
TP-ASM.ZIP) for examples of assembly language in the context of
working programs.
The following symbols, used in the example instructions, can
represent a variety of Pascal and/or Assembly symbols as indicated
in the discussion which follows:
Immediate_Byte Immediate_Word
MemoryVar_Byte MemoryVar_Word MemoryVarDWord MemoryVariable
MemoryReg_Byte MemoryReg_Word
CodeLabelSHORT CodeLabel_NEAR CodeLabel_FAR
Immediate_Byte can be:
a standard Pascal Constant, an Assembly EQU Constant, or a numeric
value or expression in the range -128 to 255
Immediate_Word can be:
a standard Pascal Constant, an Assembly EQU Constant, or a numeric
value or expression in the range -32768 to 65535
MemoryVar_Byte can be:
a Pascal BOOLEAN, BYTE, CHAR, or SHORTINT Variable or Typed Constant
or an Assembly BYTE Variable defined via DB or EQU B [..]
MemoryReg_Byte can be:
a MemoryVar_Byte or a Byte register (Al, Ah, Bl, Bh, Cl, Ch, Dl, Dh)
MemoryVar_Word can be:
a Pascal INTEGER or WORD Variable or Typed Constant
or an Assembly WORD Variable defined via DW or EQU W [..]
MemoryReg_Word can be:
a MemoryVar_Word or a Word register (Ax, Bx, Cx, Dx, Si, Di, Bp, Sp)
MemoryVarDWord can be:
a Pascal LONGINT, POINTER (^INTEGER, ^BYTE, etc), or PROCEDURE
Variable or Typed Constant, a Proc/Function VAR or UNTYPED Parameter,
or an Assembly DWORD Variable defined via DD or EQU D [..]
MemoryVariable can be:
a MemoryVar_Byte, MemoryVar_Word, or MemoryVarDWord,
or a Pascal Variable of any other Type (e.g. STRING)
CodeLabelSHORT can be:
an Assembly Code Label within the current Assemble/Internal statement,
or a Pascal Label within the current block
* TP&Asm automatically utilizes the most efficient (2-byte)
instruction form whenever the label is within 127 bytes (forward)
or 128 bytes (back) from the beginning of the next instruction
CodeLabel_NEAR can be:
an Assembly Code Label within the current Assemble/Internal statement,
a Pascal Label within the current block, or a Pascal Procedure or
Function identifier defined in the current Unit in the {$F-} state
CodeLabel_FAR must be:
a Pascal Procedure, Function, or Method identifier defined in a
separate Unit or in the current Unit in the {$F+} state.
Dh is used as a typical Byte register. It can be replaced by any of
the following Byte registers: Al, Ah, Bl, Bh, Cl, Ch, Dl, or Dh
Si is used as a typical Word register. It can be replaced by any of
the following Word registers: Ax, Bx, Cx, Dx, Si, Di, Bp, or Sp
The following list contains separate examples for instructions using
the Accumulator (AL or AX) in cases where the Accumulator version uses
a different opcode. Instructions using the Accumulator are often one
byte shorter than instructions using another register.
*══════════════════════════════ NOTES ═══════════════════════════════*)
{- Far Procedure -}
{$F+}
PROCEDURE
CodeLabel_FAR; {$F-} BEGIN END;
{- Standard constants -}
CONST
Immediate_Byte = 5;
Immediate_Word = $0213;
{- Typed Constants -}
CONST
MemoryVar_Byte: BOOLEAN = TRUE;
MemoryReg_Byte: CHAR = 'A';
{- Global Variables -}
VAR
MemoryVar_Word: WORD;
MemoryReg_Word: INTEGER;
PROCEDURE OptestProc;
{- Near Label -}
Label
CodeLabel_NEAR;
{- Local Variables -}
VAR
MemoryVarDWord: POINTER;
MemoryVariable: STRING[34];
BEGIN
Assemble
AAA
AAD
AAM
AAS
ADC AL,Immediate_Byte
ADC AX,Immediate_Word
ADC MemoryReg_Byte,Immediate_Byte
ADC MemoryReg_Byte,Dh
ADC MemoryReg_Word,Immediate_Byte
ADC MemoryReg_Word,Immediate_Word
ADC MemoryReg_Word,Si
ADC Dh,MemoryReg_Byte
ADC Si,MemoryReg_Word
ADD AL,Immediate_Byte
ADD AX,Immediate_Word
ADD MemoryReg_Byte,Immediate_Byte
ADD MemoryReg_Byte,Dh
ADD MemoryReg_Word,Immediate_Byte
ADD MemoryReg_Word,Immediate_Word
ADD MemoryReg_Word,Si
ADD Dh,MemoryReg_Byte
ADD Si,MemoryReg_Word
AND AL,Immediate_Byte
AND AX,Immediate_Word
AND MemoryReg_Byte,Immediate_Byte
AND MemoryReg_Byte,Dh
AND MemoryReg_Word,Immediate_Word
AND MemoryReg_Word,Si
AND Dh,MemoryReg_Byte
AND Si,MemoryReg_Word
CALL CodeLabel_FAR
CALL CodeLabel_NEAR
CALL MemoryVarDWord
CALL MemoryReg_Word
CBW
CLC
CLD
CLI
CMC
CMP AL,Immediate_Byte
CMP AX,Immediate_Word
CMP MemoryReg_Byte,Immediate_Byte
CMP MemoryReg_Byte,Dh
CMP MemoryReg_Word,Immediate_Byte
CMP MemoryReg_Word,Immediate_Word
CMP MemoryReg_Word,Si
CMP Dh,MemoryReg_Byte
CMP Si,MemoryReg_Word
CMPSB
CMPSW
CWD
DAA
DAS
DEC MemoryReg_Byte
DEC MemoryReg_Word
DEC Si
DIV MemoryReg_Byte
DIV MemoryReg_Word
HLT
IDIV MemoryReg_Byte
IDIV MemoryReg_Word
IMUL MemoryReg_Byte
IMUL MemoryReg_Word
IN AL,DX
IN AL,Immediate_Byte
IN AX,DX
IN AX,Immediate_Byte
INC MemoryReg_Byte
INC MemoryReg_Word
INC Si
INT 3
INT Immediate_Byte
INTO
IRET
JA CodeLabelSHORT
JAE CodeLabelSHORT
JB CodeLabelSHORT
JBE CodeLabelSHORT
JC CodeLabelSHORT
JCXZ CodeLabelSHORT
JE CodeLabelSHORT
JG CodeLabelSHORT
JGE CodeLabelSHORT
JL CodeLabelSHORT
JLE CodeLabelSHORT
JMP CodeLabelSHORT
JMP CodeLabel_FAR
JMP CodeLabel_NEAR
JMP MemoryReg_Word
JMP MemoryVarDWord
JNA CodeLabelSHORT
JNAE CodeLabelSHORT
JNB CodeLabelSHORT
JNBE CodeLabelSHORT
JNC CodeLabelSHORT
JNE CodeLabelSHORT
JNG CodeLabelSHORT
JNGE CodeLabelSHORT
JNL CodeLabelSHORT
JNLE CodeLabelSHORT
JNO CodeLabelSHORT
JNP CodeLabelSHORT
JNS CodeLabelSHORT
JNZ CodeLabelSHORT
JO CodeLabelSHORT
JP CodeLabelSHORT
JPE CodeLabelSHORT
JPO CodeLabelSHORT
JS CodeLabelSHORT
JZ CodeLabelSHORT
CodeLabelSHORT:
LAHF
LDS Si,MemoryVarDWord
LEA Si,MemoryVariable
LES Si,MemoryVarDWord
LOCK Mov Ax,[Si+2]
LODSB
LODSW
LOOP CodeLabelSHORT
LOOPE CodeLabelSHORT
LOOPNE CodeLabelSHORT
LOOPNZ CodeLabelSHORT
LOOPZ CodeLabelSHORT
MOV AL,MemoryVar_Byte
MOV AX,MemoryVar_Word
MOV DS,MemoryVar_Word
MOV DS,Si
MOV MemoryReg_Byte,Immediate_Byte
MOV MemoryReg_Byte,Dh
MOV ES,MemoryVar_Word
MOV ES,Si
MOV MemoryVar_Word,CS
MOV Si,CS
MOV MemoryVar_Word,DS
MOV Si,DS
MOV MemoryVar_Word,ES
MOV Si,ES
MOV MemoryReg_Word,Immediate_Word
MOV MemoryReg_Word,Si
MOV MemoryVar_Word,SS
MOV Si,SS
MOV Dh,MemoryReg_Byte
MOV Dh,Immediate_Byte
MOV Si,MemoryReg_Word
MOV Si,Immediate_Word
MOV SS,MemoryVar_Word
MOV SS,Si
MOV MemoryVar_Byte,AL
MOV MemoryVar_Word,AX
MOVSB
MOVSW
MUL MemoryReg_Byte
MUL MemoryReg_Word
NEG MemoryReg_Byte
NEG MemoryReg_Word
NOP
NOT MemoryReg_Byte
NOT MemoryReg_Word
OR AL,Immediate_Byte
OR AX,Immediate_Word
OR MemoryReg_Byte,Immediate_Byte
OR MemoryReg_Byte,Dh
OR MemoryReg_Word,Immediate_Word
OR MemoryReg_Word,Si
OR Dh,MemoryReg_Byte
OR Si,MemoryReg_Word
OUT DX,AL
OUT DX,AX
OUT Immediate_Byte,AL
OUT Immediate_Byte,AX
POP DS
POP ES
POP MemoryVar_Word
POP Si
POP SS
POPF
PUSH CS
PUSH DS
PUSH ES
PUSH MemoryVar_Word
PUSH Si
PUSH SS
PUSHF
RCL MemoryReg_Byte,1
RCL MemoryReg_Byte,CL
RCL MemoryReg_Word,1
RCL MemoryReg_Word,CL
RCR MemoryReg_Byte,1
RCR MemoryReg_Byte,CL
RCR MemoryReg_Word,1
RCR MemoryReg_Word,CL
REP MovSB
REPE CmpSB
REPNE CmpSB
REPNZ ScaSB
REPZ ScaSB
RET
RET Immediate_Word
RETF
RETF Immediate_Word
ROL M